#include "gpio.hpp"
#include <iostream>
using namespace std;

void SimpleGpioOperationForTest::setHighLevel()
{
    cout << this->gpio << "的" << this->pins << "号引脚 被设置为高电平" << endl;
    this->pin_status = true;
}

void SimpleGpioOperationForTest::setLowLevel()
{
    cout << this->gpio << "的" << this->pins << "号引脚 被设置为低电平" << endl;
    this->pin_status = false;
}

void SimpleGpioOperationForTest::reverseLevel()
{
    const string status = this->pin_status ? "高电平" : "低电平";
    cout << this->gpio << "的" << this->pins << "号引脚 当前是" << status << endl;
    this->pin_status = !this->pin_status;

    const string updated_status = this->pin_status ? "高电平" : "低电平";

    cout << "更新之后的状态是:" << updated_status << endl;
}



